package progress.exa5;

import java.io.FileWriter;
import java.io.IOException;

/**
 * 文件字符输出流
 */
public class FileWriterStudy {

    public static void main(String[] args) throws IOException {
        fileWriterStudy();
    }

    /**
     * 文件字符输出流
     * @throws IOException
     */
    public static void fileWriterStudy() throws IOException {
        FileWriter writer = null;
        try {
            writer = new FileWriter("四郎.txt");
            writer.write("我爱麻子...");
        }catch (Exception e) {
            e.printStackTrace();
        }finally {
            if(writer!=null) {
                writer.close();
            }
        }
    }

}
